package com.aabte.commons.jwt;

import io.jsonwebtoken.io.Decoder;
import io.jsonwebtoken.io.DecodingException;
import java.util.Base64;

/**
 * @author Daniel
 * @version 1.0
 * @date 2020/4/5
 */
public class JWTBase64Decoder implements Decoder<String, byte[]> {

  private static final JWTBase64Decoder INSTANCE = new JWTBase64Decoder();

  public static JWTBase64Decoder getInstance() {
    return INSTANCE;
  }

  @Override
  public byte[] decode(String s) throws DecodingException {
    return Base64.getDecoder().decode(s);
  }
}
